/**
 * @author: Gene
 * @age: 永远18岁的美少年
 * @Email： yangjianyun@58.com
 * @date: 2021-12-01 21:33:34
 * @description:  ts 中的继承
 */

class Person {
    name: string
    age: number

    constructor(name: string, age: number) {
        this.name = name
        this.age = age
    }

    getName(): string {
        return this.name
    }

    setName(name: string) {
        this.name = name
    }
}

// ====== ts 中类的继承 ===============
class Student extends Person {
    stuNo: number

    constructor(stuNo: number, name: string, age: number) {
        super(name, age)
        this.stuNo = stuNo
    }

    getStuNo() {
        return this.stuNo
    }
}

let s2 = new Student(224455, "Gene-Yang", 18)
console.log(s2);

export {}